<template>
	<view>
		<u-navbar title=" " :is-back="false"></u-navbar>
		<view class="title-box">
			<view class="head-text">
				让阅读成为习惯
			</view>
			<view class="head-icon">
				<view class="icon">
					<u-icon name="search" size="40" @click="searchto()"></u-icon>
				</view>
				<u-icon name="more-dot-fill" size="40"></u-icon>
			</view>
		</view>
		<!-- 主体区域 -->
		<view class="body-box">
			<view class="content-tittle">
				<u-icon name="man-add-fill" size="48rpx" color="#C4A880"></u-icon>
				<text>我的书架</text>
			</view>
			<view class="content-image-body">
				<block v-for="(item1,i1) in centerList" :key="i1">
					<view class="content-image">
						<image :src="item1.image_src" @click="changeto()"></image>
						<text>{{item1.img_name}}</text>
						<view class="text-name">
							{{item1.name}}
							<text>{{item1.read}}</text>
						</view>
					</view>
				</block>
			</view>
		</view>
		<view class="foot-box">
			<view class="foot-title">
				为你定制
			</view>
			<view class="box-nav">
				<block v-for="(item, i) in list" :key="i">
					<view class="scroll-box">
						<view class="ancient">
							{{item.name}}
						</view>
					</view>
				</block>
			</view>
			<!-- 内容 -->
			<block v-for="(item2,i2) in footList" :key="i2"> 
			<!-- 自定义组件 -->
			<book-list :item2="item2"></book-list>
			</block>	
		</view>
	</view>
</template>

<script>
	import {centerList,footList} from '../../utils/bodyList.js'
	export default {
		data() {
			return {
				centerList: centerList,
				footList: footList,
				list: [{
						name: "#古代言情"
					},
					{
						name: "#现代言情"
					},
					{
						name: "#都市生活"
					},
					{
						name: "#玄幻科技"
					}
				]
			}
		},
		methods: {
			changeto() {
				uni.navigateTo({
					url: '../book-detail/book-detail'
				})
			},
			searchto(){
				uni.navigateTo({
					url:"../searchlist/searchlist"
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.title-box {
		display: flex;
		justify-content: space-between;

		.head-text {
			font-size: 40rpx;
			font-weight: 700;
			font-family: "宋体";
			margin: 0 20rpx;
		}

		.head-icon {
			display: flex;

			.icon {
				margin: 0 20rpx;
			}

			margin: auto 30rpx;

		}
	}

	.body-box {
		background: #fff;
		margin: 20rpx 0;

		.content-tittle {
			font-size: 36rpx;
			font-weight: solid;
			padding: 20rpx;

			text {
				padding-left: 20rpx;
			}
		}

		.content-image-body {
			margin: 20rpx;
			display: flex;
			flex-wrap: wrap;
			justify-content: space-between;

			// width: 33.3%;
			.content-image {
				display: flex;
				flex-direction: column;
				margin: 20rpx 10rpx;

				.text-name {
					font-size: 24rpx;
					color: gray;

					text {
						padding-left: 10rpx;
					}
				}

				text {
					margin-top: 10rpx;
					font-size: 24rpx;
				}

				image {
					width: 180rpx;
					height: 250rpx;
					// margin-right: 30rpx;
					border-radius: 10rpx;
				}
			}
		}
	}

	.foot-box {
		display: flex;
		flex-direction: column;

		.foot-title {
			font-size: 36rpx;
			font-weight: 600;
			margin: 20rpx;
		}

		.box-nav {
			display: flex;
			justify-content: space-between;
			align-items: center;
			margin: 20rpx;

			.scroll-box {
				margin: 20rpx;

				.ancient {
					color: #18B566;
					font-size: 24rpx;
					border: 1px solid #18B566;
					border-radius: 10rpx;
					padding: 10rpx;
				}
			}
		}

		.text-nav {
			margin: 20rpx;

			.nav-list {
				font-size: 30rpx;
				// height: 100rpx;
				overflow: hidden;
				text-overflow: ellipsis;
				white-space: nowrap;
				padding-left: 20rpx;

			}
		}
	}
</style>
